[SUBROUTINE]
version = 1.14
icon = shcs-slot2.png
name = _("SHCS CBore Slot 2")
type = shcs_cbore_s2
help = _("<b>Creates a counterbore slot from two points for a socket head cap screw</b>&#10;Will mill the screw slot&#10;<span foreground='blue' style='oblique'><b>Message possible in terminal window</b></span>")
order = act pv h4 x1 y1 x2 y2 h2 screw scr_f scr_m scr_n bore_d u_depth u_dgc h6 wd wt h3 dir st u_s dpt

[PARAM_ACT]
name = _("Active")
icon = enable.png
type = bool
value = 1

[PARAM_PV]
name = _("Show design")
icon = glasses.png
type = bool
value = 1

[PARAM_H4]
name = _("Coords")
type = sub-header

[PARAM_X1]
name = _("X1")
type = float
icon = x.png
tool_tip = _("First point")
value = 0
metric_value = 0.0
header = h4

[PARAM_Y1]
name = _("Y1")
type = float
icon = y.png
tool_tip = _("First point")
value = 0
metric_value = 0.0w
header = h4

[PARAM_X2]
name = _("X2")
type = float
icon = x.png
tool_tip = _("Second point")
value = 2
metric_value = 20
header = h4

[PARAM_Y2]
name = _("Y2")
type = float
icon = y.png
tool_tip = _("Second point")
value = 1
metric_value = 30
header = h4

[PARAM_SCREW]
name = _("Select size")
type = combo-user
options = _("Fractional=1:Metric=2:Number=3")
icon = shcs.png
tool_tip = _("Select metric, fractional or numbered")
value = 1
links = scr_f=1:scr_m=2:scr_n=3
header = h2

[PARAM_SCR_F]
name = _("Fractional")
type = list
options = 1/4=31:5/16=32:3/8=33:7/16=34:1/2=35:9/16=36:5/8=37:3/4=38:7/8=39:1=10:1 1/8=41:1 1/4=42:1 1/2=43:1 3/4=44:2=45
value = 32
header = h2
hidden = 1
suffix = _("inch")

[PARAM_SCR_M]
name = _("Metric")
type = list
options = 1.6=1:2=2:2.5=3:2.6=4:3=5:4=6:5=7:6=8:8=9:10=10:12=11:14=12:16=13:18=14:20=15:24=16:30=17:36=18:42=19:48=20
value = 7
header = h2
hidden = 1
suffix = _("mm")

[PARAM_SCR_N]
name = _("Numbered screw")
type = list
options = 0=51:1=52:2=53:3=54:4=55:5=56:6=57:8=58:10=59:12=60
value = 58
header = h2
hidden = 1
prefix = #

[PARAM_BORE_D]
name = _("Counterbore depth")
type = combo-user
options = _("User defined=0:Head clears surface=1:Maximum depth=2:G-Code=3")
value = 2
icon = depth.png
tool_tip = _("Or head under surface or&#10;leave material equal to screw diameter")
header = h2
links = u_depth=0

[PARAM_U_DGC]
name = User defined depth
type = gcode
value =
header = h2
hidden = 1

[PARAM_U_DEPTH]
name = _("User defined depth")
type = float
value = -0.3
metric_value = -6
header = h2
hidden = 1

[PARAM_H2]
name = _("Screw")
type = sub-header

[PARAM_H6]
name = _("Washer")
type = sub-header

[PARAM_WD]
name = _("Diameter")
type = float
icon = washer.png
value = 0.0
metric_value = 0.0
minimum_value = 0.0
tool_tip = _("Diameter of washer used if any in usual units (specify a little larger to clear)")
header = h6

[PARAM_WT]
name = _("Thickness")
type = float
icon = washer-t.png
value = 0.0
metric_value = 0.0
minimum_value = 0.0
tool_tip = _("Thickness of washer used if any in usual units")
header = h6

[PARAM_H3]
name = _("Milling")
type = sub-header

[PARAM_DIR]
name = _("Direction")
type = combo
options = _("Clockwise=2:Counter-Clockwise=3")
icon = cw-ccw.png
tool_tip = _("Direction of path")
value = 2
header = h3

[PARAM_ST]
name = _("Cut start")
type = combo-user
options = _("User defined=0:Surface=1:Half=2:One quarter=3:Three quarter=4:G-Code=5")
icon = surface.png
tool_tip = _("Pre or user defined")
value = 1
header = h3
links = u_s=0:ugc=5

[PARAM_U_S]
name = User start
type = float
value = 0.0
metric_value = 0.0
header = h3
hidden = 1

[PARAM_UGC]
name = User gcode
type = gcode
value = 
header = h3
hidden = 1

[PARAM_USD]
name = User depth
type = float
value = 0.3
metric_value = 8.5
header = h3
hidden = 1

[PARAM_UGCD]
name = User depth gcode
type = gcode
value = 
header = h3
hidden = 1

[PARAM_DPT]
name = _("Cut down to")
type = combo-user
options = _("User defined=0:Through=1:Bottom=2:G-Code=3")
icon = depth.png
tool_tip = _("Pre defined")
value = 1
header = h3
links = usd=0:ugcd=3

[DEFINITIONS]
content =
;	<eval>self.include_once(file name here)</eval>

[CALL]
content =
	(begin #sub_name)
	(straight slot from 2 points with counterbore author : Fernand Veilleux)
	
	o<#self_id_active> if [#param_act]
		o<select> CALL [31] [#param_st] [#param_u_s] [#<surface>] [#<surface> - #<wp_depth> / 2] [#<surface> - #<wp_depth> / 4] [#<bottom> + #<wp_depth> / 4] [#param_ugc]
		o<select> CALL [32] [#param_dpt] [#param_usd] [#<bottom_through>] [#<bottom>] [#param_ugcd]
		o<select> CALL [33] [#param_bore_d] [#param_u_depth] [0] [0] [#param_u_dgc]
		
		o<shcs_size> CALL [#param_screw] [#param_scr_f] [#param_scr_m] [#param_scr_n] [#param_wd] [#param_wt] [#param_bore_d] [#33] [#31] [#32]
		
		o<line> CALL [#param_x1] [#param_y1] [#param_x2] [#param_y2]
		#<len#ID> = #<_line_len>
		#<phi#ID> = #<_line_phi>
		
		#<spindle_all_time#ID> = #<_spindle_all_time>
		#<_spindle_all_time>   = 1
		o<rectangle> CALL [#param_x1] [#param_y1] [#<len#ID> + #<_shcs_bore_dia>] [#<_shcs_bore_dia>] [#<phi#ID>] [#<len#ID> / 2] [0] [1] [#<_shcs_bore_dia> / 2 - 0.0001] [0] [#param_dir] [#31] [#<_shcs_bore_depth>] [#param_pv]
		#<_spindle_all_time>   = #<spindle_all_time#ID>
		o<rectangle> CALL [#param_x1] [#param_y1] [#<len#ID> + #<_shcs_body_dia>] [#<_shcs_body_dia>] [#<phi#ID>] [#<len#ID> / 2] [0] [1] [#<_shcs_body_dia> / 2 - 0.0001] [0] [#param_dir] [#<_shcs_bore_depth>] [#32] [#param_pv]
		
	o<#self_id_active> endif
	(end #sub_name)
